#1.a
a1 = [8, 1, 2, 3, 4, 5, 77, 99, 33, 10, 11, 22, 33, 44, 55, 66, 7, 2, 3, 4, 7, 8, 0]

#1.b
a2 = Array.new
for i in (0..(a1.size-1))
  if (a1[i].odd?)
        a2.insert(a2.size-1, a1[i])
  end
end

#1.c

oddSum = a2.inject { |x,n| x+n }

#1.d
a3 = Array.new(a1)
a3.sort
a3.reverse

#1.e

puts('a1')
for i in (0..(a1.size-1))
  a1 [i].display
  puts(',')
  puts
end

puts('a2')
for i in (0..(a2.size-1))
  a2[i].display
  puts(',')
  puts
end

puts('a3')
for i in (0..(a3.size-1))
  a3[i].display
  puts(',')
puts
end

puts ('oddSum')
puts (oddSum)



